package com.ruoyi.after_sale.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.after_sale.mapper.AfterSaleMapper;
import com.ruoyi.after_sale.domain.AfterSale;
import com.ruoyi.after_sale.service.IAfterSaleService;

/**
 * 订单售后Service业务层处理
 * 
 * @author 张富饶
 * @date 2025-05-22
 */
@Service
public class AfterSaleServiceImpl implements IAfterSaleService 
{
    @Autowired
    private AfterSaleMapper afterSaleMapper;

    /**
     * 查询订单售后
     * 
     * @param id 订单售后主键
     * @return 订单售后
     */
    @Override
    public AfterSale selectAfterSaleById(Long id)
    {
        return afterSaleMapper.selectAfterSaleById(id);
    }

    /**
     * 查询订单售后列表
     * 
     * @param afterSale 订单售后
     * @return 订单售后
     */
    @Override
    public List<AfterSale> selectAfterSaleList(AfterSale afterSale)
    {
        return afterSaleMapper.selectAfterSaleList(afterSale);
    }

    /**
     * 新增订单售后
     * 
     * @param afterSale 订单售后
     * @return 结果
     */
    @Override
    public int insertAfterSale(AfterSale afterSale)
    {
        afterSale.setCreateTime(DateUtils.getNowDate());
        return afterSaleMapper.insertAfterSale(afterSale);
    }

    /**
     * 修改订单售后
     * 
     * @param afterSale 订单售后
     * @return 结果
     */
    @Override
    public int updateAfterSale(AfterSale afterSale)
    {
        return afterSaleMapper.updateAfterSale(afterSale);
    }

    /**
     * 批量删除订单售后
     * 
     * @param ids 需要删除的订单售后主键
     * @return 结果
     */
    @Override
    public int deleteAfterSaleByIds(Long[] ids)
    {
        return afterSaleMapper.deleteAfterSaleByIds(ids);
    }

    /**
     * 删除订单售后信息
     * 
     * @param id 订单售后主键
     * @return 结果
     */
    @Override
    public int deleteAfterSaleById(Long id)
    {
        return afterSaleMapper.deleteAfterSaleById(id);
    }
}
